
--[[

    slimui - Copyright (c) 2011 atom0s, All rights reserved.

    See Copyright notice in slimui.lua
    
]]--

class 'RadioGroup: GroupBox' { ... };

----------------------------------------------------------------------------------
-- func: RadioGroup.__init__
-- desc: Constructor called when this object is first created.
----------------------------------------------------------------------------------
function RadioGroup.__init__( self )
    GroupBox.__init__( self );
end

----------------------------------------------------------------------------------
-- func: RadioGroup:Create
-- desc: Creates a new RadioGroup object.
----------------------------------------------------------------------------------
function RadioGroup:Create( parent )
    if parent == nil or parent._object == nil then
        slimui:err( 'RadioGroup:Create - parent must be set to create a control!' );
    end
    
    self._object = createRadioGroup( parent._object );
    
    if self._object == nil then
        slimui:err( 'RadioGroup:Create - failed to initialize a new object.' );
    end
    
    return self;
end

----------------------------------------------------------------------------------
-- func: RadioGroup:GetRows
-- desc: Returns the number of rows in this radio group.
----------------------------------------------------------------------------------
function RadioGroup:GetRows( )
    return radiogroup_getRows( self._object );
end

----------------------------------------------------------------------------------
-- func: RadioGroup:GetItems
-- desc: Returns the radio group items as a String object.
----------------------------------------------------------------------------------
function RadioGroup:GetItems( )
    return radiogroup_getItems( self._object );
end

----------------------------------------------------------------------------------
-- func: RadioGroup:GetColumns
-- desc: Returns the number of columns of this radio group.
----------------------------------------------------------------------------------
function RadioGroup:GetColumns( )
    return radiogroup_getColumns( self._object );
end

----------------------------------------------------------------------------------
-- func: RadioGroup:SetColumns
-- desc: Sets the number of columns for this radio group.
----------------------------------------------------------------------------------
function RadioGroup:SetColumns( cols )
    radiogroup_setColumns( self._object, cols );
end

----------------------------------------------------------------------------------
-- func: RadioGroup:OnClick
-- desc: Sets this radio group controls OnClick event handler.
----------------------------------------------------------------------------------
function RadioGroup:OnClick( func )
    radiogroup_onClick( self._object, func );
end



--[[ Debug information. ]]--------------------------------------------------------
if ( slimui:isdebug() == true ) then
    slimui:msg( '(Control) radiogroup.lua successfully loaded.' );
end